
#ifndef __CLIENT_H__
#define __CLIENT_H__

#include <time.h>

#define CLI_STRLEN 255

struct buf_t;

struct client_t {
	char user[CLI_STRLEN];
	char pass[CLI_STRLEN];
	struct buf_t *bufin;
	struct buf_t *bufout;
	char cmd[CLI_STRLEN];
	char tag[CLI_STRLEN];
	int status;
	time_t lastcmd;
	time_t starttime;

	char cliaddr[CLI_STRLEN];
	char servaddr[CLI_STRLEN];
	int servport;
};

extern struct client_t g_client;

int client_input(int fd, void *arg);
int client_trans(int fd, void *arg);
int client_write(int fd, void *arg);
int client_timeout();

#endif // __CLIENT_H__

